package org.senRPC.client.provider.controler;

import io.netty.channel.ChannelHandlerContext;

import org.senRPC.client.provider.controler.DefaultProvider;
import org.senRPC.remoting.model.NettyChannelInactiveProcessor;

/**
 *
 * @author senrian
 * @description provider的netty inactive触发的事件
 * @time
 * @modifytime
 */
public class DefaultProviderInactiveProcessor implements NettyChannelInactiveProcessor {

	private DefaultProvider defaultProvider;

	public DefaultProviderInactiveProcessor(DefaultProvider defaultProvider) {
		this.defaultProvider = defaultProvider;
	}

	@Override
	public void processChannelInactive(ChannelHandlerContext ctx) {
		defaultProvider.setProviderStateIsHealthy(false);
	}

}
